def extractNetworkIPv4(ip,mask):
    data = ip.split(".")
    
    result = ""
    for i in range(4):
        if i < mask/8:
            result += str(data[i])
        else:
            result += "0"
        
        if i < 3:
            result+= "."
    return result